<!DOCTYPE html>
<html lang="en">

  <head>
    <script src='https://unpkg.com/@eyelly/print/dist'></script>
  </head>

  <body>
    <div id='content'> this is content to print </div>
    <div> this is normal content </div>
    <button id='button1'>normal print</button>
    <button id='button2'>new window print</button>
    <script>
      const content = document.getElementById('content')
      const button1 = document.getElementById('button1')
      const button2 = document.getElementById('button2')

      button1.addEventListener('click', () => {
        print({
          content
        })
      })

      button2.addEventListener('click', () => {
        print({
          content,
          newWindow: true,
          title: 'print example'
        })
      })
    </script>
  </body>

</html>
